﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;

using RPMiniMarketServer.DataBase;

namespace RPMiniMarketServer
{
    /// <summary>
    /// Descripción breve de SuperMarketWS
    /// </summary>
    [WebService(Namespace = "http://RPMiniMarket.com.ar/quickMart")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]

    public class SuperMarketWS : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        public float getProductPrice(long barCode)
        {

            SuperMarketDB db = new SuperMarketDB();

            return (float)db.getProductPrice(barCode);
        }

        [WebMethod]
        public List<ProductPrice> getProductsPrice(List<long> barCodes)
        {

            SuperMarketDB db = new SuperMarketDB();

            return db.getProductsPrice(barCodes);
        }

        [WebMethod]
        public int getProductStock(long barCode)
        {
            SuperMarketDB db = new SuperMarketDB();

            return db.getProductStock(barCode);
        }

        [WebMethod]
        public List<int> getProductsStock(List<long> barCodes)
        {
            SuperMarketDB db = new SuperMarketDB();

            return db.getProductsStock(barCodes);
        }
    }
}
